package com.hf.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateChangeString {
	
	public static Date getStringToDate(String date){
		
		Date datetime =null;
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		try{
			datetime = sdf.parse(date);
		}catch(Exception e){
			e.printStackTrace();
		}
		return datetime;
	}
	
	public static String getDateToString(Date date){
		String datetime = null;
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		try{
			datetime = sdf.format(date);
		}catch(Exception e){
			e.printStackTrace();
		}
		return datetime;
	}
	
}
